﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TrainingsApp.IPADApp.UserControls.Main;
using TrainingsApp.Model;
using ZJFramework10.Extension;
namespace TrainingsApp.IPADApp.UserControls2 {
    public partial class UC_PreRegister : ControlBase {
        protected void Page_Load(object sender, EventArgs e) {
            if (!IsPostBack) {
                TemplateUserInfoManager.Clear();
            }
            Initialize();
        }



        protected void Initialize() {

            dropProvince.DataSource = TrainingsApp.Logic.TS_Province_Logic.TS_Province_ListByPaging(1000, 1).TS_Province_List;
            dropProvince.DataTextField = "ProvinceName";
            dropProvince.DataValueField = "Idx";
            dropProvince.DataBind();

        }


        protected void btnSubmit_Click(object sender, EventArgs args) {
            TS_User_Entity entity = new TS_User_Entity();
            entity.ProvinceId = this.dropProvince.SelectedValue.AsInt();
            entity.AreaId = ZJFramework10.Utility.FormManager.GetValue<int>("dropArea");
            entity.RegionId = ZJFramework10.Utility.FormManager.GetValue<int>("dropRegion");
            entity.SchoolId = ZJFramework10.Utility.FormManager.GetValue<int>("dropSchool");

            TemplateUserInfoManager.Push(entity);

            Response.Redirect("/Register.aspx");
        }
    }
}